package com.init.iblog.controller;

import com.init.iblog.domain.ResponseResult;
import com.init.iblog.service.LinkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 友链控制层
 */
@RestController
@RequestMapping("/link")
@CrossOrigin
public class LinkController {

    @Autowired
    private LinkService linkService;

    /**
     * 查询所有友链
     * @return
     */
    @GetMapping("/getAllLink")
    public ResponseResult getAllLink(){
        System.out.println("++++++++++++++++进入/getAllLink查询所有友链接口++++++++++++++++");
        return linkService.getAllLink();
    }
}
